/**
 * 创建人:冯斌    创建日期:2008-2-22
 */
package com.wsj.util.tool;

import java.util.ArrayList;

/**
 * @author fengbin
 *
 */
public class AutoArrayList extends ArrayList {
    
    
    private Class itemClass;   
    
    public AutoArrayList(Class itemClass) {   
        this.itemClass = itemClass;   
    }   
       
    public Object get(int index) {   
        try {   
            while (index >= size()) {   
                add(itemClass.newInstance());   
            }   
        } catch (Exception e) {   
            e.printStackTrace();   
        }   
        return super.get(index);   
    }   


}
